﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace DesignPatternToolkit.Wizard.Controls
{
	public partial class NavigationControls : UserControl
	{
		public event EventHandler NextButtonClicked;
		public event EventHandler PreviousButtonClicked;

		public NavigationControls()
		{
			InitializeComponent();

			NextButton.Click += new EventHandler(OnNextButtonClicked);
			PreviousButton.Click += new EventHandler(OnPreviousButtonClicked);
		}

		private void OnPreviousButtonClicked(object sender, EventArgs e)
		{
			if (PreviousButtonClicked != null)
				PreviousButtonClicked(this, EventArgs.Empty);
		}

		private void OnNextButtonClicked(object sender, EventArgs e)
		{
			if (NextButtonClicked != null)
				NextButtonClicked(this, EventArgs.Empty);
		}

		public bool NextButtonVisible
		{
			get { return NextButton.Visible; }
			set { NextButton.Visible = value; }
		}

		public bool PreviousButtonVisible
		{
			get { return PreviousButton.Visible; }
			set { PreviousButton.Visible = value; }
		}

		public void SetTextNextButton(string text)
		{
			NextButton.Text = text;
		}

		public void SetTextPreviousButton(string text)
		{
			PreviousButton.Text = text;
		}
	}
}
